home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
clean
/
sun3.lha
/
Sun3
/
deltaS.dcl
< prev
next >
Wrap
Text File
|
1992-08-07
|
1KB
|
34 lines
SYSTEM MODULE deltaS;
== Version 0.8
==
== String operations
==
RULE
:: +S !STRING !STRING -> STRING; == concatenate arg2 to arg1
:: =S !STRING !STRING -> BOOL; == true if arg1 equals arg2
:: <>S !STRING !STRING -> BOOL; == true if arg1 does not equal arg2
:: <S !STRING !STRING -> BOOL; == true if arg1 is less then arg2
:: >S !STRING !STRING -> BOOL; == true if arg1 is more then arg2
:: <=S !STRING !STRING -> BOOL; == true if arg1 is less or equal to arg2
:: >=S !STRING !STRING -> BOOL; == true if arg1 is more or equal to arg2
:: INDEX !STRING !INT -> CHAR; == get the arg2th char from arg1
:: SLICE !STRING !INT !INT -> STRING; == get substr arg2 .. (arg3 - 1) from arg1
:: UPDATE !STRING !CHAR !INT -> STRING; == replace arg3th char in arg1 with arg2
:: LENGTH !STRING -> INT; == number of characters in string
<<
String comparison is based on lexical order.
String indices, as used in INDEX, SLICE and UPDATE, range from 0. SLICE s a b
returns a string including the characters on position a and b. For illegal values
of a and b an error message is given (and the program is aborted!).
Notice that LENGTH gives the number of characters in the string and not the
index of the last character.
>>